<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 98248
  Date: 2020/10/13
  Time: 14:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>交易记录</title>
</head>
<body>
<form action="${pageContext.request.contextPath }/list" method="post" name="fm">
    查询日期范围<input type="date" name="starDate" id="start" value="${starDate}"/>到
    <input type="date" name="endDate" id="end" value="${endDate}"/>
    <input name="curPageNo" id="curPageNo" value="1" hidden/>
    <input type="submit" value="查询"/>
</form>
<table border="1">
    <thead>
    <tr>
        <td>交易日期</td>
        <td>交易额</td>
        <td>账号余额</td>
        <td>交易类型</td>
        <td>备注</td>
    </tr>
    </thead>
    <c:forEach items="${page.pageList}" var="item">
        <tr>
            <td>${item.transactionDate}</td>
            <td>${item.transactionAmount}</td>
            <td>${item.balance}</td>
            <td>${item.transactionType}</td>
            <td>${item.remark}</td>
        </tr>
    </c:forEach>
</table>
共${page.totalCount }条记录&nbsp;&nbsp;
[${page.curPageNo }/${page.totalPage }]
<c:if test="${page.curPageNo>1 }">
    <a href="javascript:void(0)" onclick="changeNum(1)">首页</a>&nbsp;&nbsp;
    <a href="javascript:void(0)" onclick="changeNum(${page.curPageNo-1})">上一页</a>&nbsp;&nbsp;
</c:if>

<c:if test="${page.curPageNo<page.totalPage }">
    <a href="javascript:void(0)" onclick="changeNum(${page.curPageNo+1})">下一页</a>&nbsp;&nbsp;
    <a href="javascript:void(0)" onclick="changeNum(${page.totalPage})">末页</a>
</c:if>
</body>
</html>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery.js"></script>
<script type="text/javascript">
    function changeNum(index){
        $("#curPageNo").val(index);
        $("form").submit();
    }
</script>